home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FLI106C.ZIP;1 / WINCLOSE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-12  |  1.0 KB  |  58 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // FusionWindow
  8. //
  9.  
  10. #include "fliwin.h"
  11. #include "colors.h"
  12.  
  13. #ifdef __BCPLUSPLUS__
  14. #pragma hdrstop
  15. #endif
  16.  
  17. #include <alloc.h>
  18.  
  19. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  20. //
  21. // CloseWindow()
  22. //
  23. // Closes the current window
  24. //
  25. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  26.  
  27. void FusionWindow::CloseWindow()
  28. {
  29.   if (!NumberOfWindows)
  30.     return;
  31.  
  32.   RemoveAllMenus();
  33.  
  34.   BlazeClass::InvisibleCursor();
  35.  
  36.   delete Windows[0];
  37.  
  38.   if (NumberOfWindows>1)
  39.   {
  40.     for (register int i=0;i<NumberOfWindows-1;i++)
  41.       Windows[i]=Windows[i+1];
  42.     NumberOfWindows--;
  43.     Windows[0]->Active=1;
  44.     RefreshWindows();
  45.   }
  46.   else
  47.   {
  48.     free(Windows);
  49.     Windows=0;
  50.     NumberOfWindows=0;
  51.     MouseHide();
  52.     Blaze.CharacterFill(0,1,Blaze.WhatWidth(),Blaze.WhatHeight()-2,
  53.       Colors.WorkSpace,176);
  54.     MouseShow();
  55.   }
  56. }
  57.  
  58.